
# Set working directory to main PSD file collection
#setwd( "~/java/PSD/" )

# RUN the java code to build dating matrix and list of
# absolutely EVERYONE that has registered.
#system( "java psd.RegParser2 -file test-simple" )
#warning( "Using file names as ids for testing purposes" )

# find old ids and new ids for everyone.  This builds a csv file.
source( "Rs/old_date_recorder.R" )
#warning( "old date recorder disabled" )

# clean up
rm( list=ls() )

# Start from scratch, see what we get!  load.data reads the output of 
# the java file and updates banlist.csv (the list of who is here
# and whether they have paid and what their status is).
source( "Rs/polyDataReadSql.R" )

load.data( "All" )

ig = readline( "Now make your table.csv file.  Use the make.table.table function in tableMatcher.R to start.\nHit <return> to proceed.\n> " )


# NOW FIX BAN LIST 
# Go and hand-edit ban list in a seperate terminal. 
# Add "y" to the "In" column of everyone that is
# actually present and ready to date.  Hit return to continue when done.
ig = readline( "Hand Edit Ban List and update with those actually checked in.\nHit <return> to continue.\n> " )

# This reloads the data selecting only those who have In=="y".  
load.data( "In" )

# get demographics for those present.
source( "Rs/demographics.R" )
F = compute.demographics( P )
print( F )

match = readline( "Ready to make matches.  How many rounds of dating?  0 for none.\n> " )
if ( match > 0 ) {	
	source( "Rs/polyMatch.R" )
	trials = readline( "How many random trials should be generated?  More trials will find a better solution, in probability.  Try 10, if you have no idea.\n> " )
	make.matches( match, trials=trials )
}

